package com.thf.controller.user;

import com.alibaba.fastjson.JSON;
import com.thf.model.ResultData;
import com.thf.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.Map;

@Controller
public class UserFindAllController {

    @Resource
    private UserService userService ;

    @RequestMapping("/user/get")
    @ResponseBody
    public String userFindAll(Integer startPage, Integer pageSize , String val) throws ServletException, IOException {
        Map map = JSON.parseObject(val,Map.class);
        ResultData result = userService.userFind(startPage,pageSize,map);
        String resJson = JSON.toJSONString(result);
        return  resJson ;
    }
}
